package com.ruoyi.cat.service.impl;

import java.util.Collections;
import java.util.List;

import com.ruoyi.cat.domain.CatWinningRecords;
import com.ruoyi.cat.domain.DTO.WinningDTO;
import com.ruoyi.cat.mapper.CatWinningRecordsMapper;
import com.ruoyi.cat.service.ICatWinningRecordsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 中奖记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-24
 */
@Service
public class CatWinningRecordsServiceImpl implements ICatWinningRecordsService
{
    @Autowired
    private CatWinningRecordsMapper catWinningRecordsMapper;

    /**
     * 查询中奖记录
     * 
     * @param id 中奖记录主键
     * @return 中奖记录
     */
    @Override
    public CatWinningRecords selectCatWinningRecordsById(Long id)
    {
        return catWinningRecordsMapper.selectCatWinningRecordsById(id);
    }

    @Override
    public CatWinningRecords selectCatWinningRecordsByRedemptionCode(String redemptionCode) {
        return catWinningRecordsMapper.selectCatWinningRecordsByRedemptionCode(redemptionCode);
    }

    /**
     * 查询中奖记录列表
     * 
     * @param catWinningRecords 中奖记录
     * @return 中奖记录
     */
    @Override
    public List<CatWinningRecords> selectCatWinningRecordsList(CatWinningRecords catWinningRecords)
    {
        return catWinningRecordsMapper.selectCatWinningRecordsList(catWinningRecords);
    }

    /**
     * 新增中奖记录
     * 
     * @param catWinningRecords 中奖记录
     * @return 结果
     */
    @Override
    public int insertCatWinningRecords(CatWinningRecords catWinningRecords)
    {
        return catWinningRecordsMapper.insertCatWinningRecords(catWinningRecords);
    }

    /**
     * 修改中奖记录
     * 
     * @param catWinningRecords 中奖记录
     * @return 结果
     */
    @Override
    public int updateCatWinningRecords(CatWinningRecords catWinningRecords)
    {
        return catWinningRecordsMapper.updateCatWinningRecords(catWinningRecords);
    }

    /**
     * 批量删除中奖记录
     * 
     * @param ids 需要删除的中奖记录主键
     * @return 结果
     */
    @Override
    public int deleteCatWinningRecordsByIds(Long[] ids)
    {
        return catWinningRecordsMapper.deleteCatWinningRecordsByIds(ids);
    }

    /**
     * 删除中奖记录信息
     * 
     * @param id 中奖记录主键
     * @return 结果
     */
    @Override
    public int deleteCatWinningRecordsById(Long id)
    {
        return catWinningRecordsMapper.deleteCatWinningRecordsById(id);
    }

    @Override
    public Long getWinningRecordsCount(Long activityId) {
        return catWinningRecordsMapper.getWinningRecordsCount(activityId);
    }

    @Override
    public CatWinningRecords getWinningData(Long activityId, Long userId) {
        return catWinningRecordsMapper.getWinningData(activityId,userId);
    }

    @Override
    public List<WinningDTO> getVerification(Long activityId) {
        return catWinningRecordsMapper.getVerification(activityId);
    }

    @Override
    public int updateCatWinningRecordsByRedemptionCode(CatWinningRecords catWinningRecords) {
        return catWinningRecordsMapper.updateCatWinningRecordsByRedemptionCode(catWinningRecords);
    }
}
